<!-- 城市区域选择
    应用于：
        发布供求
   -->
<template>
<div>
    <el-cascader :options="areaList" v-model="value" @change="change" transfer :placeholder="placeholder" clearable filterable></el-cascader>
</div>
</template>

<script>
import cityOptions from "@/components/data/region/data.js";
export default {
    props:{
        placeholder:{
            type:String,
            default:'Please choose'
        },
        val:{
            type:String,
        }
    },
    computed:{
        areaList(){
            return cityOptions
        }
    },
    data() {
        return {
            value: [],
        }
    },
    mounted() {
        if(this.val){
            this.value=this.val.indexOf(',')!=-1&&this.val.split(',');
        }
    },
    methods: {
        change(value){
            this.$emit('change',value)
        },
    }
}
</script>
<style lang="scss" scoped>
    .el-cascader{
        width: 100%;
    }
</style>